<!-- Right side column. Contains the navbar and content of the page -->
<aside class="right-side">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>
            <?php echo $this->lang->line('menu_izin'); ?>
            <small><?php echo $this->lang->line('webname'); ?></small>
        </h1>
    </section>

    <!-- Main content -->
    <section class="content">
        <div class="row">
            <!-- left column -->
            <div class="col-xs-12">
                <!-- general form elements -->
                <div class="box box-danger">
                    <div class="box-header">
                        <h3 class="box-title">
                            <?php if ($izin_id) { ?>
                                <?php echo $this->lang->line('update'); ?>
                            <?php } else { ?>
                                <?php echo $this->lang->line('tambah'); ?>
                            <?php } ?>
                        </h3>
                    </div><!-- /.box-header -->
                    <!-- form start -->
                    <?php if ($izin_id) { ?>
                        <?php echo form_open('izins/edit/id/' . $izin_id); ?>
                    <?php } else { ?>
                        <?php echo form_open('izins/add'); ?>
                    <?php } ?>
                    <div class="box-body">
                        <?php if (!is_null($message)) echo $message; ?>
                        <?php echo validation_errors(); ?>

                        <div class="form-group">
                            <label><?php echo $this->lang->line('tanggal_keluar'); ?></label>
                            <div class="input-group">
                                <div class="input-group-addon">
                                    <i class="fa fa-calendar"></i>
                                </div>
                                <input id="in_tanggal_keluar" name="in_tanggal_keluar" type="text" class="form-control" value="<?php echo set_value('in_tanggal_keluar', (isset($izins->izin_keluar)) ? date('d/m/Y H:i:s', strtotime($izins->izin_keluar)) : date('d/m/Y H:i:s')); ?>" />
                            </div><!-- /.input group -->
                        </div><!-- /.form group -->

                        <div class="form-group">
                            <label><?php echo $this->lang->line('tanggal_masuk'); ?></label>
                            <div class="input-group">
                                <div class="input-group-addon">
                                    <i class="fa fa-calendar"></i>
                                </div>
                                <input id="in_tanggal_masuk" name="in_tanggal_masuk" type="text" class="form-control" value="<?php echo set_value('in_tanggal_masuk', (isset($izins->izin_masuk)) ? date('d/m/Y H:i:s', strtotime($izins->izin_masuk)) : date('d/m/Y H:i:s')); ?>" />
                            </div><!-- /.input group -->
                        </div><!-- /.form group -->

                        <div class="form-group">
                            <label ><?php echo $this->lang->line('santri'); ?></label>
                            <select name="in_santri" class="form-control selectpicker" data-live-search="true">
                                <?php foreach ($santris AS $val => $santri) { ?>
                                    <option <?php if (set_value('in_santri', (isset($izins->izin_santri)) ? $izins->izin_santri : '') == $val) { ?>selected<?php } ?> value="<?php echo $val; ?>"><?php echo $santri; ?></option>
                                <?php } ?>
                            </select>
                        </div>

                        <div class="form-group">
                            <label><?php echo $this->lang->line('keperluan'); ?></label>
                            <textarea class="form-control" type="text" name="in_keperluan" rows="3" ><?php echo set_value('in_keperluan', (isset($izins->izin_keperluan)) ? $izins->izin_keperluan : ''); ?></textarea>
                        </div>
                    </div><!-- /.box-body -->

                    <div class="box-footer">
                        <?php if ($izin_id) { ?>
                            <input class="btn btn-primary" type="submit" name="btn_update" value="<?php echo $this->lang->line('update'); ?>" />
                        <?php } else { ?>
                            <input class="btn btn-primary" type="submit" name="btn_tambah" value="<?php echo $this->lang->line('tambah'); ?>" />
                        <?php } ?>
                        <?php echo anchor('izins/', $this->lang->line('batal'), array('class' => 'btn btn-success')); ?>
                    </div>
                    </form>
                </div><!-- /.box -->
            </div><!--/.col (right) -->
        </div>   <!-- /.row -->
    </section><!-- /.content -->
</aside><!-- /.right-side -->